package io.读数据并打印;

import java.io.FileInputStream;
import java.io.IOException;
import java.io.InputStream;

public class demo1 {
    public static void main(String[] args) throws IOException {
        InputStream is = new FileInputStream("D:\\test.txt");
        int buf = is.read();
        while (buf!=-1) {
            System.out.printf("%c", buf);
            buf = is.read();
        }

       /* byte[] buf1 = new byte[is.available()];
        int len= is.read(buf1);

        while (len != -1) {
            String string=new String(buf1);
            System.out.println(string);
            len = is.read(buf1);
        }*/
    }
}
